
package edu.weber.bookstore.models;

import edu.weber.bookstore.database.UserCart;
import java.util.HashMap;
import java.util.Map;

/**
 * 
 * 
 */
public class UserCartIndexModel extends ViewModel
{
	private UserCart _userCart;
	private float _cartTotal;
	
	/**
	 * Constructor for the data on the UserCart index page.
	 * @param userCart userCart object for which to display
	 * @param cartTotal total cost of the items in the UserCart. qty * price
	 */
	public UserCartIndexModel(UserCart userCart, float cartTotal)
	{
		_userCart = userCart;
		_cartTotal = cartTotal;
	}
	
	@Override
	public Map<String, Object> getMap()
	{
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("userCart", _userCart);
		map.put("cartTotal", _cartTotal);
		
		map.putAll(super.getMap());
		return map;
	}
	
}
